package com.wkbb.basic.thread;

import com.wkbb.basic.service.ClassInfoService;
import com.wkbb.common.dto.basic.FamilyInfoDto;
import lombok.extern.slf4j.Slf4j;

import java.util.List;


/**
 * @author dengjingyuan
 * @date 2019-11-11 17:46
 */
@Slf4j
public class ImSaveFamilyTask implements Runnable {
    private ClassInfoService classInfoService;

    private List<FamilyInfoDto> familyInfoListByClassIdList;



    public ImSaveFamilyTask(ClassInfoService classInfoService, List<FamilyInfoDto> familyInfoListByClassIdList) {
        this.classInfoService = classInfoService;
        this.familyInfoListByClassIdList = familyInfoListByClassIdList;

    }

    public ImSaveFamilyTask() {

    }

    @Override
    public void run() {
        log.info("*********ImSaveFamilyTask********classInfoService:{},familyInfoListByClassIdList:{}", classInfoService, familyInfoListByClassIdList);
        try {
            classInfoService.saveAutoGroupUserFamily(familyInfoListByClassIdList);
        } catch (Exception e) {
            log.error("*******ImSaveFamilyTask**********", e);
        }
    }
}